package com.zaofan.dao;

import com.zaofan.dao.base.DaoSupportImpl;
import com.zaofan.mobile.bean.HotelOrderRecord;

import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

/**
 * Created by Administrator on 2016/12/20.
 */
public class HotelOrderRecordDao extends DaoSupportImpl<HotelOrderRecord> {


    public void addOrder(HotelOrderRecord record) {
        try {
            String sql = "INSERT INTO t_hotel_order_record (hotelNo,orderNo,userMobile) VALUES " +
                    "( '"+record.getHotelNo() +"' , '"+ record.getOrderNo() +"' , '" + record.getUserMobile() +"' );";
            System.err.println(sql);
            QueryRunner runner = new QueryRunner(getDataSource());
            runner.update(sql);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
